<template>
	<view class="bg-white">
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="content">详情</block>
			<!-- <block slot="right">
				<button class="cu-btn bg-red shadow" @click="urging">催办</button>
			</block> -->
		</cu-custom>
		<view style="padding: 15px;">
			<!-- <view style="background-color: #F3F5FC;border-radius: 10px;padding: 15px 10px;position: relative;">
				<text style="color: #4591FE;font-weight: 400;font-size: 12px;">
					创建日期：{{dataObj.createTime}}
				</text>
				<view
					style="text-align: center;border-radius: 0px 10px 0px 10px;padding: 5px 10px;background-color: #3085FE;width: 80px;position: absolute;right: 0; top: 0;">
					<text style="color: #FFFFFF;">进行中</text>
				</view>
			</view> -->

			<view style="margin-top: 20px;">
				<view class="action" style="margin-bottom: 10px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #000000;font-weight: bold;font-size: 30rpx;">
						基础信息
					</text>
				</view>
				<view class="flex" style="width: 300px;">
					<view class="flex-sub padding-sm margin-xs radius textStyle">
						选择员工
					</view>
					<view class="flex-sub padding-sm margin-xs radius">
						{{dataObj.workNo}}-{{dataObj.userId_dictText}}
					</view>
				</view>
				<view class="flex" style="width: 300px;">
					<view class="flex-sub padding-sm margin-xs radius textStyle">
						姓名
					</view>
					<view class="flex-sub padding-sm margin-xs radius">
						{{dataObj.userId_dictText}}
					</view>
				</view>
				<view class="flex" style="width: 300px;">
					<view class="flex-sub padding-sm margin-xs radius textStyle">
						工号
					</view>
					<view class="flex-sub padding-sm margin-xs radius">
						{{dataObj.workNo}}
					</view>
				</view>
				<view class="flex" style="width: 300px;">
					<view class="flex-sub padding-sm margin-xs radius textStyle">
						公司
					</view>
					<view class="flex-sub padding-sm margin-xs radius">
						{{dataObj.company_dictText}}
					</view>
				</view>

				<view class="flex" style="width: 300px;">
					<view class="flex-sub padding-sm margin-xs radius textStyle">
						部门
					</view>
					<view class="flex-sub padding-sm margin-xs radius">
						{{dataObj.orgCodeTxt}}
					</view>
				</view>



			</view>
			<view class="action" style="margin-top: 10px;">
				<text class="cuIcon-titles" style="color: #1E5EFF;"></text>
				<text style="color: #000000;font-weight: bold;font-size: 30rpx;">
					体检报告
				</text>
			</view>
			<view style="margin-top: 10px;background-color: #F9F9F9;border-radius: 10px;padding: 15px 25px;">
				<view style="display: flex;">
					<!-- <view style="width: 20px;height: 20px;background-color: #34B483;border-radius: 50%;"></view>
					<span style="margin-left: 15px;color:#101317;font-weight: 500;">体检报告</span> -->
					<!-- <image class="nav-right-image" src="@/static/images/xiazai.png"></image> -->
					<!-- <a style="margin-left: 15px;color: #4591FE;" @click="reUpload">重新上传</a> -->
				</view>
				<view>
					{{dataObj.medicalReportSecs!= null ? dataObj.medicalReportSecs[0].medicalReport: null}}
				</view>

			</view>



		</view>
	</view>
</template>

<script>
	import moment from 'moment';
	export default {
		data() {
			return {
				createTime: '2023/10/10 12:00',
				renewalTime: '10天',
				retireTime: '235天',
				dataObj: {
					id: '',
					company: '',
					name: '杨慧',
					sex: '男',
					idCard: '293993002010010111',
					inTime: '2023/10/05',
					workNumber: '218395',
					phone: '13634645415',
					age: '23',
					birthday: '1997/10/10',
					contractType: '劳务合同',
					workAge: '13',
					post: '工人',
					startTime: '2023/10/05',
					endTime: '2025/10/05',
					intervalTime: '三个月',
					signTime: '2023/10/05',
					contractNum: 1,
					handledBy: '小雪',
				},

				approvalRecords: [{
					title: '总经理',
					name: '陈婷婷',
					area: '手写区域',
					state: '同意',
					manager: '企管',
					dateTime: '2023/10/10 12:00'
				}]
			}
		},
		onLoad: function(options) {
			this.dataObj.id = options.id;
			// 在这里可以使用获取到的 id 参数进行后续操作
		},
		mounted() {
			this.getDetail()
		},
		computed: {

		},
		methods: {
			getDetail() {
				let params = {
					id: this.dataObj.id
				}
				this.$http.get(
						"/crm_medical_report/crmMedicalReport/list/", {
							params: params
						})
					.then(res => {
						if (res.data.success) {
							let records = res.data.result.records
							console.log(records)
							this.dataList = records
							this.dataList.forEach((item) => {
								this.dataObj = res.data.result.records[0]
							})

							// this.dataObj['avatar'] = this.getFileAccessHttpUrl(this.dataObj['avatar'])
							console.log(this.dataObj['company'])
							this.approvalRecords = this.dataObj.approvalRecords
						}
					})
			},
			urging(id) {
				const params = {
					applicationId: id,
					approvalType: 1
				}
				this.$http.get("/crm_on_hand/crmOnHand/urge", {
						params: params
					})
					.then(res => {
						if (res.data.success) {
							this.$refs.urgingPopup.open('center')
						}
					})
			},
			reUpload() {
				console.log('重新上传')
			}
		}
	}
</script>

<style>
	.cu-form-group {
		background-color: #ffffff;
		line-height: 15px;
		padding: 0.5px 15px;
		display: flex;
		align-items: center;
		min-height: 42px;
		justify-content: space-between;
	}

	.cu-form-group uni-picker .picker {
		line-height: 15px;
		font-size: 15px;
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
		width: 100%;
		text-align: right;
	}

	.cu-form-group uni-picker::after {
		font-family: cuIcon;
		line-height: 15px;
		display: block;
		content: "\e6a3";
		position: absolute;
		font-size: 17px;
		color: #8799a3;
		width: 31px;
		text-align: center;
		top: 0;
		bottom: 0;
		right: -10px;
		margin: auto;
	}

	/deep/ .uni-radio-input {
		width: 15px;
		height: 15px;
	}

	.nav-right-image {
		width: 40rpx;
		height: 40rpx;
		margin-left: 15px;
	}

	.padding-sm {
		padding: 5px;
	}

	.textStyle {
		font-size: 13px;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		color: #101317;
		line-height: 22px;
	}
</style>